import request from '@/utils/request'

export function getDepartments() {
  return request({
    url: './company/department'
  })
}

// 封装删除部门的接口：
export function delDepartments(id) {
  return request({
    method: 'delete',
    url: '/company/department/' + id
  })
}

// 新增部门的接口
export function addDepartments(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 添加编辑回显数据功能：
export function getDepartmentDetails(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 封装编辑部门接口
export function editDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'put',
    data
  })
}
